﻿#include "resetmainwindow.h"

ResetMainWindow::ResetMainWindow(QObject *parent)
    : QObject{parent}
{
    w=new MainWindow;
    connect(w,&MainWindow::restart,this,&ResetMainWindow::reset);
}
void ResetMainWindow::reset(){
    qDebug()<<" restart ";
    w->close();
    delete w;
    w=new MainWindow;
    //w对象销毁后 其信号与槽的连接也一并销毁了
    connect(w,&MainWindow::restart,this,&ResetMainWindow::reset);
}
